set more off
clear all
cls

*=0 for main analysis, =1 for robustness (Table 8, columns 1,2)
local working_age_flag=0

use "../international_data/prices_by_country", replace

merge 1:1 country year using "../international_data/consumption_gdp"
drop _merge


merge 1:1 country year using "../international_data/total_economy_database"
drop _merge

merge 1:1 country year using "../international_data/labor_force"
drop _merge

merge 1:1 country year using "../international_data/population_final"
drop _merge

sort country year



keep if year>=1950 /*hours data start*/
keep if year<=2018 /*some shaky data in 2019*/
drop if CPI_recreation_real==. 
drop if CPI_hh_items_real==.


*make relevant stuff real
gen C_hhit_real=fcons_hh_items/CPI_all/CPI_hh_items_real
gen C_rec_real=fcons_rec_total/CPI_all/CPI_recreation_real
gen C_nonrec_real=(fcons_total-fcons_rec_total)/CPI_all
gen C_nr_nhh_real=(fcons_total-fcons_rec_total-fcons_hh_items)/CPI_all
gen Employee_compensation_real=femployee_compensation_current/CPI_all
gen GDP_real=fGDP_current/CPI_all

rename Population Population_TED
rename Hours_per_worker Hours_per_worker_TED

gen Population_working_age=populationT_25_29+populationT_30_34+populationT_35_39+populationT_40_44+populationT_45_49+populationT_50_54+populationT_55_59+populationT_60_64
gen Population_20_74 = populationT_20_24 + Population_working_age + populationT_70_74


if `working_age_flag'==0 {
	*adult population
	gen Population_denom = Population_20_74

	replace numberEmp_T_70_74=0 if numberEmp_T_70_74==.
	replace numberEmp_T_65_69=0 if numberEmp_T_65_69==.
	gen Employment=numberEmp_T_20_24+numberEmp_T_25_64+numberEmp_T_65_69+numberEmp_T_70_74

	gen GDP_real_per_hour=GDP_real/Hours
	gen GDP_real_per_capita=GDP_real/Population_denom
	gen Comp_real_per_hour=Employee_compensation_real/Hours

	gen C_rec_real_per_capita=C_rec_real/Population_denom
	gen C_nonrec_real_per_capita=C_nonrec_real/Population_denom
	gen C_nr_nhh_real_per_capita=C_nr_nhh_real/Population_denom
	gen C_hhit_real_per_capita=C_hhit_real/Population_denom

	gen Hours_per_capita=Hours/Population_denom
	gen Hours_per_worker=Hours/Employment
	
	replace numberLF_W_70_74=0 if numberLF_W_70_74==.
	replace numberLF_W_65_69=0 if numberLF_W_65_69==. 
	replace numberPop_W_70_74=0 if numberPop_W_70_74==.
	replace numberPop_W_65_69=0 if numberPop_W_65_69==. 
	
	gen LF_women=(numberLF_W_20_24+numberLF_W_25_64+numberLF_W_65_69+numberLF_W_70_74)/(numberPop_W_20_24+numberPop_W_25_64 +numberPop_W_65_69+numberPop_W_70_74)
	gen share_young_men = (numberPop_M_20_24+numberPop_M_25_34)/Population_denom


}

if `working_age_flag'==1 {
	* working age population
	gen Population_denom = Population_working_age
	gen Employment=numberEmp_T_25_64

	gen GDP_real_per_hour=GDP_real/Hours
	gen GDP_real_per_capita=GDP_real/Population_denom
	gen Comp_real_per_hour=Employee_compensation_real/Hours

	gen C_rec_real_per_capita=C_rec_real/Population_denom
	gen C_nonrec_real_per_capita=C_nonrec_real/Population_denom
	gen C_nr_nhh_real_per_capita=C_nr_nhh_real/Population_denom
	gen C_hhit_real_per_capita=C_hhit_real/Population_denom

	gen Hours_per_capita=Hours/Population_denom
	gen Hours_per_worker=Hours/Employment

	gen LF_women=numberLF_W_25_64/numberPop_W_25_64 
	gen share_young_men = numberPop_M_25_34/Population_denom
}

* Tag to remove Great Recession observations
gen recession = 0
replace recession = 1 if year == 2008 | year == 2009


*******************************************************************************
***************************** OLS Main (Table 7) ******************************
*******************************************************************************
preserve

	local list CPI_recreation_real Hours_per_capita Hours_per_worker Comp_real_per_hour GDP_real_per_capita LF_women share_young_men GDP_real_per_hour

	bys country: egen N=count(year)
	keep if N>=15
	
	sort country year
	foreach var of local list {
		by country: gen gr_`var'=log(`var'/`var'[_n-1])
		by country: egen mean_gr_`var'=mean(gr_`var') if recession == 0
	}

	sort country year
	by country: gen id=_n
	keep if id == 1

	gen y_h_per_worker=mean_gr_Hours_per_worker
	gen y_h_per_capita=mean_gr_Hours_per_capita

	gen x_p=mean_gr_CPI_recreation_real
	gen x_comp_per_hour=mean_gr_Comp_real_per_hour
	gen x_w_GDP_per_capita=mean_gr_GDP_real_per_capita
	gen x_w_GDP_per_hour=mean_gr_GDP_real_per_hour
	gen x_LFW=mean_gr_LF_women
	gen x_share_young_men=mean_gr_share_young_men
	
	
	** regressions for the paper
	label var y_h_per_capita "Hours per capita"
	label var x_p "Real recreation price"
	label var x_w_GDP_per_capita "Real GDP per capita"
	label var x_w_GDP_per_hour "Real GDP per hour"
	label var x_comp_per_hour "Real worker compensation per hour"
	label var x_LFW "Female labor force participation"
	label var x_share_young_men "Share of young men"
	
	* Regression per capita
	* Table 7
	eststo: reg y_h_per_capita x_p x_w_GDP_per_hour, robust
	eststo: reg y_h_per_capita x_p x_comp_per_hour, robust
	eststo: reg y_h_per_capita x_p x_comp_per_hour x_LFW, robust
	eststo: reg y_h_per_capita x_p x_comp_per_hour x_share_young_men, robust	

restore





********************************************************************************
*******************   GMM Main (Tables 1, 2)  **********************************
********************************************************************************

*if working_age_flag=1, produces columns 1,2 of Table 8

preserve

	local list CPI_recreation_real Hours_per_capita Hours_per_worker Comp_real_per_hour GDP_real_per_capita /*
	*/LF_women C_rec_real_per_capita C_nonrec_real_per_capita C_nr_nhh_real_per_capita share_young_men GDP_real_per_hour /*
	*/ C_hhit_real_per_capita CPI_hh_items_real 
	

	bys country: egen N=count(year)
	keep if N>=15 /*at least 15 observations to compute trends*/

	sort country year
	
	* Compute trend by average
	foreach var of local list {
		by country: gen gr_`var'=log(`var'/`var'[_n-1])
		by country: egen mean_gr_`var' = mean(gr_`var') if recession == 0

	}

	sort country year
	by country: gen id=_n
	drop if id>1


	gen y_h_per_worker=mean_gr_Hours_per_worker
	gen y_h=mean_gr_Hours_per_capita
	gen x_p=mean_gr_CPI_recreation_real
	gen x_hhit=mean_gr_CPI_hh_items_real
	gen x_w=mean_gr_Comp_real_per_hour
	gen x_w_GDP_per_capita=mean_gr_GDP_real_per_capita
	gen x_w_GDP_per_hour=mean_gr_GDP_real_per_hour
	gen x_LFW=mean_gr_LF_women
	gen y_c=mean_gr_C_nonrec_real_per_capita
	gen y_c_nh=mean_gr_C_nr_nhh_real_per_capita
	gen y_d=mean_gr_C_rec_real_per_capita
	gen y_hhit=mean_gr_C_hhit_real_per_capita
	gen x_share_young_men=mean_gr_share_young_men
	
	
	

	*Table 1
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w_GDP_per_hour-{beta_p}*x_p-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w_GDP_per_hour-({beta_p}-1)*x_p-{const_y_d}) /*
		*/(eq3: y_h-{beta_w}*x_w_GDP_per_hour-{beta_p}*x_p-{const_y_h}), /*
		*/instruments(eq1: x_w_GDP_per_hour x_p) /*
		*/instruments(eq2: x_w_GDP_per_hour x_p) /*
		*/instruments(eq3: x_w_GDP_per_hour x_p) /*
		*/winitial(identity) igmm  level(90) nolog 
	estat overid
	
	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w-{beta_p}*x_p-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w-({beta_p}-1)*x_p-{const_y_d}) /*
		*/(eq3: y_h-{beta_w}*x_w-{beta_p}*x_p-{const_y_h}), /*
		*/instruments(eq1: x_w x_p) /*
		*/instruments(eq2: x_w x_p) /*
		*/instruments(eq3: x_w x_p) /*
		*/winitial(identity) igmm  level(90) nolog
	estat overid
	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w-{beta_p}*x_p-{const_y})/*
		*/(eq2: y_d-({beta_w}+1)*x_w-({beta_p}-1)*x_p-{const_y}) /*
		*/(eq3: y_h-{beta_w}*x_w-{beta_p}*x_p-{const_y}), /*
		*/instruments(eq1: x_w x_p) /*
		*/instruments(eq2: x_w x_p) /*
		*/instruments(eq3: x_w x_p) /*
		*/winitial(identity) igmm  level(90) nolog
	estat overid
		
	
	*Table 2
	eststo: gmm (eq1: y_c_nh-({beta_w}+1)*x_w_GDP_per_hour-{beta_p}*x_p-{beta_hhit}*x_hhit-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w_GDP_per_hour-({beta_p}-1)*x_p-{beta_hhit}*x_hhit-{const_y_d}) /*
		*/(eq3: y_hhit-({beta_w}+1)*x_w_GDP_per_hour-{beta_p}*x_p-({beta_hhit}-1)*x_hhit-{const_y_hhit}) /*
		*/(eq4: y_h-{beta_w}*x_w_GDP_per_hour-{beta_p}*x_p-{beta_hhit}*x_hhit-{const_y_h}), /*
		*/instruments(eq1: x_w_GDP_per_hour x_p x_hhit) /*
		*/instruments(eq2: x_w_GDP_per_hour x_p x_hhit) /*
		*/instruments(eq3: x_w_GDP_per_hour x_p x_hhit) /*
		*/instruments(eq4: x_w_GDP_per_hour x_p x_hhit) /*
		*/winitial(identity) igmm  level(90) nolog 
	estat overid
	
	
	
	eststo: gmm (eq1: y_c_nh-({beta_w}+1)*x_w-{beta_p}*x_p-{beta_hhit}*x_hhit-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w-({beta_p}-1)*x_p-{beta_hhit}*x_hhit-{const_y_d}) /*
		*/(eq3: y_hhit-({beta_w}+1)*x_w-{beta_p}*x_p-({beta_hhit}-1)*x_hhit-{const_y_hhit}) /*
		*/(eq4: y_h-{beta_w}*x_w-{beta_p}*x_p-{beta_hhit}*x_hhit-{const_y_h}), /*
		*/instruments(eq1: x_w x_p x_hhit) /*
		*/instruments(eq2: x_w x_p x_hhit) /*
		*/instruments(eq3: x_w x_p x_hhit) /*
		*/instruments(eq4: x_w x_p x_hhit) /*
		*/winitial(identity) igmm  level(90) nolog 
	estat overid
	
	eststo: gmm (eq1: y_c_nh-({beta_w}+1)*x_w-{beta_p}*x_p-{beta_hhit}*x_hhit-{const_y})/*
		*/(eq2: y_d-({beta_w}+1)*x_w-({beta_p}-1)*x_p-{beta_hhit}*x_hhit-{const_y}) /*
		*/(eq3: y_hhit-({beta_w}+1)*x_w-{beta_p}*x_p-({beta_hhit}-1)*x_hhit-{const_y}) /*
		*/(eq4: y_h-{beta_w}*x_w-{beta_p}*x_p-{beta_hhit}*x_hhit-{const_y}), /*
		*/instruments(eq1: x_w x_p x_hhit) /*
		*/instruments(eq2: x_w x_p x_hhit) /*
		*/instruments(eq3: x_w x_p x_hhit) /*
		*/instruments(eq4: x_w x_p x_hhit) /*
		*/winitial(identity) igmm  level(90) nolog 
	estat overid
	

	
restore



********************************************************************************
****************   GMM, subsample analysis (Table 9)   *************************
********************************************************************************


preserve

	rename C_nonrec_real_per_capita C_nrec_real_per_capita

 	local list CPI_recreation_real Hours_per_capita Comp_real_per_hour /*
 	*/C_rec_real_per_capita C_nrec_real_per_capita GDP_real_per_hour
	
	keep CPI_recreation_real Hours_per_capita Comp_real_per_hour /*
 	*/C_rec_real_per_capita C_nrec_real_per_capita GDP_real_per_hour /*
	*/country year recession 

	foreach var of local list {
		keep if `var'!=.
	}
	bys country: gen id=_n
	bys country: gen N=_N
	keep if N>=20 /*at least 20 years to conduct subsample analysis*/
	foreach var of local list {
		by country: gen gr_`var'=log(`var'/`var'[_n-1])
		by country: egen av_gr_`var'_e = mean(gr_`var') if (recession == 0) & (id<=N/2)
		by country: egen aux = mean(gr_`var') if (recession == 0) & (id>N/2)
		by country: egen av_gr_`var' = mean(gr_`var') if (recession == 0)
		by country: egen av_gr_`var'_l=mean(aux)
		drop aux
	}
	drop id N
	sort country year
	by country: gen id=_n
	drop if id>1
	
	local flag_early=1 /*=1 for columns 1,2; =0 for columns 3,4; =2 for columns 5,6 */
	

	if `flag_early'==1 {
		gen y_h=av_gr_Hours_per_capita_e
		gen x_p=av_gr_CPI_recreation_real_e
		gen x_w=av_gr_Comp_real_per_hour_e
		gen x_w_GDP_per_hour=av_gr_GDP_real_per_hour_e
		gen y_c=av_gr_C_nrec_real_per_capita_e
		gen y_d=av_gr_C_rec_real_per_capita_e
	}
	if `flag_early'==0 {
		gen y_h=av_gr_Hours_per_capita_l
		gen x_p=av_gr_CPI_recreation_real_l
		gen x_w=av_gr_Comp_real_per_hour_l
		gen x_w_GDP_per_hour=av_gr_GDP_real_per_hour_l
		gen y_c=av_gr_C_nrec_real_per_capita_l
		gen y_d=av_gr_C_rec_real_per_capita_l
	}
	if `flag_early'==2 {
		gen y_h=av_gr_Hours_per_capita
		gen x_p=av_gr_CPI_recreation_real
		gen x_w=av_gr_Comp_real_per_hour
		gen x_w_GDP_per_hour=av_gr_GDP_real_per_hour
		gen y_c=av_gr_C_nrec_real_per_capita
		gen y_d=av_gr_C_rec_real_per_capita
	}	

	
	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w-{beta_p}*x_p-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w-({beta_p}-1)*x_p-{const_y_d}) /*
		*/(eq3: y_h-{beta_w}*x_w-{beta_p}*x_p-{const_y_h}), /*
		*/instruments(eq1: x_w x_p) /*
		*/instruments(eq2: x_w x_p) /*
		*/instruments(eq3: x_w x_p) /*
		*/winitial(identity) igmm   level(90) nolog
	estat overid

	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w-{beta_p}*x_p-{const_y})/*
		*/(eq2: y_d-({beta_w}+1)*x_w-({beta_p}-1)*x_p-{const_y}) /*
		*/(eq3: y_h-{beta_w}*x_w-{beta_p}*x_p-{const_y}), /*
		*/instruments(eq1: x_w x_p) /*
		*/instruments(eq2: x_w x_p) /*
		*/instruments(eq3: x_w x_p) /*
		*/winitial(identity) igmm   level(90) nolog
	estat overid
	
	



	
restore



********************************************************************************
*******************   Hours per worker (Table 8, columns 5,6)  *****************
********************************************************************************


 preserve

	local list CPI_recreation_real Hours_per_capita Hours_per_worker Comp_real_per_hour GDP_real_per_capita /*
	*/LF_women C_rec_real_per_capita C_nonrec_real_per_capita C_nr_nhh_real_per_capita share_young_men GDP_real_per_hour /*
	*/ C_hhit_real_per_capita CPI_hh_items_real 
	

	bys country: egen N=count(year)
	keep if N>=15

	sort country year
	
	* Compute trend by average
	foreach var of local list {
		by country: gen gr_`var'=log(`var'/`var'[_n-1])
		by country: egen mean_gr_`var' = mean(gr_`var') if recession == 0
	}

	sort country year
	by country: gen id=_n
	drop if id>1


	gen y_h_per_worker=mean_gr_Hours_per_worker
	gen y_h=mean_gr_Hours_per_capita
	gen x_p=mean_gr_CPI_recreation_real
	gen x_hhit=mean_gr_CPI_hh_items_real
	gen x_w=mean_gr_Comp_real_per_hour
	gen x_w_GDP_per_capita=mean_gr_GDP_real_per_capita
	gen x_w_GDP_per_hour=mean_gr_GDP_real_per_hour
	gen x_LFW=mean_gr_LF_women
	gen y_c=mean_gr_C_nonrec_real_per_capita
	gen y_c_nh=mean_gr_C_nr_nhh_real_per_capita
	gen y_d=mean_gr_C_rec_real_per_capita
	gen y_hhit=mean_gr_C_hhit_real_per_capita
	gen x_share_young_men=mean_gr_share_young_men
	


	
	drop if country == "HRV" /* The labor force data is unreliable */
	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w_GDP_per_hour-{beta_p}*x_p-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w_GDP_per_hour-({beta_p}-1)*x_p-{const_y_d}) /*
		*/(eq3: y_h_per_worker-{beta_w}*x_w_GDP_per_hour-{beta_p}*x_p-{const_y_h}), /*
		*/instruments(eq1: x_w_GDP_per_hour x_p) /*
		*/instruments(eq2: x_w_GDP_per_hour x_p) /*
		*/instruments(eq3: x_w_GDP_per_hour x_p) /*
		*/winitial(identity) igmm  level(90) nolog 
	estat overid 
	
	
	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w-{beta_p}*x_p-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w-({beta_p}-1)*x_p-{const_y_d}) /*
		*/(eq3: y_h_per_worker-{beta_w}*x_w-{beta_p}*x_p-{const_y_h}), /*
		*/instruments(eq1: x_w x_p) /*
		*/instruments(eq2: x_w x_p) /*
		*/instruments(eq3: x_w x_p) /*
		*/winitial(identity) igmm  level(90) nolog
	estat overid 
	
	
	
restore


********************************************************************************
********************   20 years of data (Table 8, columns 3,4)  ****************
********************************************************************************


 preserve

	local list CPI_recreation_real Hours_per_capita Hours_per_worker Comp_real_per_hour GDP_real_per_capita /*
	*/LF_women C_rec_real_per_capita C_nonrec_real_per_capita C_nr_nhh_real_per_capita share_young_men GDP_real_per_hour /*
	*/ C_hhit_real_per_capita CPI_hh_items_real 
	

	bys country: egen N=count(year)
	keep if N>=20

	sort country year
	
	* Compute trend by average
	foreach var of local list {
		by country: gen gr_`var'=log(`var'/`var'[_n-1])
		by country: egen mean_gr_`var' = mean(gr_`var') if recession == 0
	}

	sort country year
	by country: gen id=_n
	drop if id>1


	gen y_h_per_worker=mean_gr_Hours_per_worker
	gen y_h=mean_gr_Hours_per_capita
	gen x_p=mean_gr_CPI_recreation_real
	gen x_hhit=mean_gr_CPI_hh_items_real
	gen x_w=mean_gr_Comp_real_per_hour
	gen x_w_GDP_per_capita=mean_gr_GDP_real_per_capita
	gen x_w_GDP_per_hour=mean_gr_GDP_real_per_hour
	gen x_LFW=mean_gr_LF_women
	gen y_c=mean_gr_C_nonrec_real_per_capita
	gen y_c_nh=mean_gr_C_nr_nhh_real_per_capita
	gen y_d=mean_gr_C_rec_real_per_capita
	gen y_hhit=mean_gr_C_hhit_real_per_capita
	gen x_share_young_men=mean_gr_share_young_men
	

	* Exercises in the paper hours per capita	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w_GDP_per_hour-{beta_p}*x_p-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w_GDP_per_hour-({beta_p}-1)*x_p-{const_y_d}) /*
		*/(eq3: y_h-{beta_w}*x_w_GDP_per_hour-{beta_p}*x_p-{const_y_h}), /*
		*/instruments(eq1: x_w_GDP_per_hour x_p) /*
		*/instruments(eq2: x_w_GDP_per_hour x_p) /*
		*/instruments(eq3: x_w_GDP_per_hour x_p) /*
		*/winitial(identity) igmm  level(90) nolog 
	estat overid
	
	
	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w-{beta_p}*x_p-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w-({beta_p}-1)*x_p-{const_y_d}) /*
		*/(eq3: y_h-{beta_w}*x_w-{beta_p}*x_p-{const_y_h}), /*
		*/instruments(eq1: x_w x_p) /*
		*/instruments(eq2: x_w x_p) /*
		*/instruments(eq3: x_w x_p) /*
		*/winitial(identity) igmm  level(90) nolog
	estat overid
	



	
restore


********************************************************************************
******************   with GR (Table 8, columns 7,8)  ***************************
********************************************************************************


 preserve

	local list CPI_recreation_real Hours_per_capita Hours_per_worker Comp_real_per_hour GDP_real_per_capita /*
	*/LF_women C_rec_real_per_capita C_nonrec_real_per_capita C_nr_nhh_real_per_capita share_young_men GDP_real_per_hour /*
	*/ C_hhit_real_per_capita CPI_hh_items_real 
	

	bys country: egen N=count(year)
	keep if N>=15

	sort country year
	
	* Compute trend by average
	foreach var of local list {
		by country: gen gr_`var'=log(`var'/`var'[_n-1])
		by country: egen mean_gr_`var' = mean(gr_`var')

	}

	sort country year
	by country: gen id=_n
	drop if id>1


	gen y_h_per_worker=mean_gr_Hours_per_worker
	gen y_h=mean_gr_Hours_per_capita
	gen x_p=mean_gr_CPI_recreation_real
	gen x_hhit=mean_gr_CPI_hh_items_real
	gen x_w=mean_gr_Comp_real_per_hour
	gen x_w_GDP_per_capita=mean_gr_GDP_real_per_capita
	gen x_w_GDP_per_hour=mean_gr_GDP_real_per_hour
	gen x_LFW=mean_gr_LF_women
	gen y_c=mean_gr_C_nonrec_real_per_capita
	gen y_c_nh=mean_gr_C_nr_nhh_real_per_capita
	gen y_d=mean_gr_C_rec_real_per_capita
	gen y_hhit=mean_gr_C_hhit_real_per_capita
	gen x_share_young_men=mean_gr_share_young_men
	

	* Exercises in the paper hours per capita	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w_GDP_per_hour-{beta_p}*x_p-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w_GDP_per_hour-({beta_p}-1)*x_p-{const_y_d}) /*
		*/(eq3: y_h-{beta_w}*x_w_GDP_per_hour-{beta_p}*x_p-{const_y_h}), /*
		*/instruments(eq1: x_w_GDP_per_hour x_p) /*
		*/instruments(eq2: x_w_GDP_per_hour x_p) /*
		*/instruments(eq3: x_w_GDP_per_hour x_p) /*
		*/winitial(identity) igmm  level(90) nolog 
	estat overid
	
	
	
	eststo: gmm (eq1: y_c-({beta_w}+1)*x_w-{beta_p}*x_p-{const_y_c})/*
		*/(eq2: y_d-({beta_w}+1)*x_w-({beta_p}-1)*x_p-{const_y_d}) /*
		*/(eq3: y_h-{beta_w}*x_w-{beta_p}*x_p-{const_y_h}), /*
		*/instruments(eq1: x_w x_p) /*
		*/instruments(eq2: x_w x_p) /*
		*/instruments(eq3: x_w x_p) /*
		*/winitial(identity) igmm  level(90) nolog
	estat overid
	



	
restore



